package cn.qf.v3;

public class Car extends Vehicle {
    // 品牌
    private String brand;

    public Car(String name, String brand) {
        // 调用父类的构造器
        super(name);

        this.brand = brand;
    }

    public Car(String name, String brand, int oil, int loss) {
        super(name, oil, loss);
        this.brand = brand;
    }

    public String getBrand() {
        return brand;
    }

    // 重写父类的方法
    @Override
    public void show() {
        System.out.println("=====轿车=====");
        System.out.println("车名：" + getName());
        System.out.println("品牌：" + brand);
        System.out.println("油量：" + getOil());
        System.out.println("损耗度：" + getLoss());
        System.out.println("=============");
    }

}
